/*=====================================================================================================================
                    Copyright(c) 2009 Geometric PLM Software Corp. All rights reserved.
                             Unpublished - All rights reserved
=======================================================================================================================
File description:
    Filename: tc_item.h
    Module  : (geometric) itk module.

        This file manages the operations of the item.

=======================================================================================================================
Date               Name              Description of Change
14-Jul-2009        Penn,Xie          Initialize creation
$HISTORY$
=====================================================================================================================*/
#ifndef GITK_TC_ITEM_H
#define GITK_TC_ITEM_H

#ifdef __cplusplus
    extern "C"
    {
#endif

    /**
    * Get the item revision tag.
    * @param itemTagOrItemRevTag - <I> the tag of the item or the item revision
    * @param masterTag           - <O> the tag of the item master or item revision master
    * @return - ITK_ok or error code
    */
    extern int GITEM_get_master_revision( tag_t itemTagOrItemRevTag, tag_t *masterTag );

    /**
    * Get the lastest item revision tag which has status.
    * @param item        - <I> the tag of the item
    * @param hasStatus   - <I> whether the latest object has status.
    * @param isBased     - <I> whether the latest object is a baseline object.
    * @param itemRev     - <O> the tag of the lastest item rev which has status
    * @return - ITK_ok or error code
    */
    extern int GITEM_get_latest_revision( tag_t item, logical hasStatus, logical isBased, tag_t *itemRev );

    /**
    * Get the bomview revision tag of an item revision by typeName
    * @param itemRev      - <I> the tag of the item revision
    * @param typeName     - <O> the type name of bomview revision
    * @param bvr          - <O> the tag of the bvr, NULL_TAG if no found
    * @return - ITK_ok or error code
    */
    extern int GITEM_getBVRbyViewType(tag_t itemRev, tag_t viewType, tag_t *bvr);

    /**
    * Get the baseline tag of an item revision by typeName
    * @param item                - <I> the tag of the item
    * @param baselineStatusName  - <I> The release status name of the Baseline Revisions that are requested. If empty, then all the Baseline Revisions are returned.
    * @param n_revs              - <O> Number of Baseline Revisions matching the specified criteria.
    * @param baseline_revs       - <O> n_revs The list of memory allocated Baseline Revisions
    * @return - ITK_ok or error code
    */
    extern int GITEM_list_baselineRevs(tag_t item, const char *baselineStatusName, int *n_revs, tag_t **baseline_revs);

#ifdef __cplusplus
    }
#endif


#endif //GITK_TC_ITEM_H
